<%-- 
    Document   : zakat
    Created on : Nov 1, 2010, 4:20:16 PM
    Author     : M Bilal
--%>

<%@include file="../includes/header.jspf"%>


<div style="padding: 5px 0px 0px 0px;">
    <div class="div_navigation" id="div_navigation">
        <a href="<%=context_Path%>" class="LinkIndex">Home</a>&nbsp;&gt;
        <a href="<%=context_Path%>/religion/index.jsp" class="LinkIndex">Religion</a>&nbsp;&gt;
        <span class="navigation_Leaf">Zakat Calculator</span>
    </div>
</div>

<table width="100%" align="left" cellpadding="0" cellspacing="0" style="text-align: left;font-weight: bold;">
    <tr>
        <td style="background-image:url('../images/new/top_bar_02.jpg');background-repeat: repeat-x;height:26px;">
            <b style='padding:0px 0px 0px 2px;'>Zakat Calculator</b>
        </td>
    </tr>
</table>
<div style="height:1px;clear: both;"> &nbsp; </div>
<div style="padding: 5px 0px 0px 5px;">
<%
thisPage="Religion-Zakat";
  int intCash=0,intRefDep=0,intTax=0,intShares=0,intBusiCash=0,intBusiInv=0,intNetIncom=0,intGoldrate=0;
    float flGold=0;
    double flTotal=0;
    String strMsg="";

    String ulang = ( (String)request.getParameter("ulang" ) != null ? (String)request.getParameter("ulang"):"en");

  if(request.getParameter("isPost")!=null && request.getParameter("isPost").equalsIgnoreCase("true"))
  {

    boolean isValid=true;
    try{intNetIncom = Integer.parseInt(request.getParameter("txt7"));}catch(Exception ex){isValid=false;strMsg="invalid net income value.";}
    try{intBusiInv = Integer.parseInt(request.getParameter("txt6"));}catch(Exception ex){isValid=false;strMsg="invalid business inventory value.";}
    try{intBusiCash = Integer.parseInt(request.getParameter("txt5"));}catch(Exception ex){isValid=false; strMsg="invalid business cash value.";}
    try{intShares = Integer.parseInt(request.getParameter("txt4"));}catch(Exception ex){isValid=false;strMsg="invalid shared, stock value.";}
    try{flGold = Float.parseFloat(request.getParameter("gold"));}catch(Exception ex){isValid=false;strMsg="invalid gold weight.";}
    try{intTax = Integer.parseInt(request.getParameter("txt3"));}catch(Exception ex){isValid=false;strMsg="invalid expected tax refund value.";}
    try{intRefDep = Integer.parseInt(request.getParameter("txt2"));}catch(Exception ex){isValid=false;strMsg="invalid refundable deposits value.";}
    try{intCash = Integer.parseInt(request.getParameter("txt1"));}catch(Exception ex){isValid=false;strMsg="invalid Cash value.";}
    try{intGoldrate = Integer.parseInt(request.getParameter("grate"));}catch(Exception ex){isValid=false;strMsg="invalid gold rate value.";}
    if(isValid)
    {
      //flGold=;
     flTotal=(intCash+intRefDep+intTax+intShares+intBusiCash+intBusiInv+intNetIncom+flGold*intGoldrate);
     double total=flTotal;
     if(total<22000)
     {
       flTotal=0;
     }
     else
     {
     flTotal=flTotal*(0.025);
     }

     if(ulang.equals("ur")){

        strMsg=" ????  ??? "+total+"<br/> ???? ??????: "+flTotal+"<br/><br/>";

     }else{
       strMsg="Total amount: "+total+"<br/>Total Zakat: "+flTotal+"<br/><br/>";
       }
    }
      out.println(strMsg);
  }
  %>

 <%
   if(ulang.equals("ur")){
 %>
    <form  method="post">
    ???? ?? ????  - ??? ????)<br/>
            <input type="text" align="right"  value="<%=intGoldrate%>" name="grate" mask="[0-9]"/>
            <br/>
            <br/>
               ??? ???<br/>
            <input type="text" value="<%=intCash%>" name="txt1"/>
            <br/>
            ???? ????? ?????- ??? ?? ????
            <br/>
            <input type="text" value="<%=intRefDep%>" name="txt2"/>
            <br/>
           ????? ???? ????? ????
             <br/>
            <input type="text" value="<%=intTax%>" name="txt3"/>
            <br/>
           ???? ?? ?????- ???? ????
            <br/>
            <input type="text" value="<%=flGold%>" name="gold"/>
            <br/>
            ????/  ???? / ????? / ???? ?????
            <br/>
            <input type="text" value="<%=intShares%>" name="txt4"/>
            <br/>
           ???? ???/ ???? ???? ????
            <br/>
            <input type="text" value="<%=intBusiCash%>" name="txt5"/>
            <br/>
            ???? ??? ?
            <br/>
            <input type="text" value="<%=intBusiInv%>" name="txt6"/>
            <br/>
            ?? ?? ????  ???? ?? ?? ???? ???? ??
            <br/>
            <input type="text" value="<%=intNetIncom%>" name="txt7"/>
            <input type="hidden" value="true" name="isPost"/>
            <br/>
            <input type="submit" value="?????? ????? ????" name="">
    </form>
	<%
	 } else{

	%>
        <form  method="post" action="">
            Gold rate(one tola)<br/>
            <input type="text"  value="<%=intGoldrate%>" name="grate" mask="[0-9]"/>
            <br/>
            Cash on hand and in bank accounts<br/>
            <input type="text" value="<%=intCash%>" name="txt1"/>
            <br/>
            Refundable deposits (e.g. on rented apartment)
            <br/>
            <input type="text" value="<%=intRefDep%>" name="txt2"/>
            <br/>
            Expected Tax refund
             <br/>
             <input type="text" value="<%=intTax%>" name="txt3" />
            <br/>
            Gold (tolas)
            <br/>
            <input type="text" value="<%=flGold%>" name="gold"/>
            <br/>
            Shares, stocks, bonds, IRA, pension plans, options, etc.
            <br/>
            <input type="text" value="<%=intShares%>" name="txt4"/>
            <br/>
            Business cash on hand and in banks plus invoices due.
            <br/>
            <input type="text" value="<%=intBusiCash%>" name="txt5"/>
            <br/>
            Business inventory
            <br/>
            <input type="text" value="<%=intBusiInv%>" name="txt6"/>
            <br/>
            Net income you are entitled to as of Zakat due date.
            <br/>
            <input type="text" value="<%=intNetIncom%>" name="txt7"/>
            <input type="hidden" value="true" name="isPost"/>
            <br/>
            <input type="submit" value="compute" name="">
    </form>

<%
 }//end
%>

</div>
<div style="padding:0px 0px 0px 0px;text-decoration: underline;">
    <jsp:include page="../banner.jsp">
        <jsp:param name="w" value="<%=width%>"/>
    </jsp:include>
</div>

<%@include file="../includes/footer.jspf"%>

<%
wpb.LogVisit(strIP, thisPage, strGsm, strApn, strBrand, strModel, app, request.getQueryString());
%>